package priv.pront.code.robot.roboCom_uni;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

/**
 * @Description:
 * @Author: pront
 * @Time:2023-06-29 14:34
 */
public class NOIP2009_普及组_分数线划定 {

    static StreamTokenizer st = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    static int n, m, target;

    static List<Info> list = new ArrayList<>();
    static List<Info> list2 = new ArrayList<>();

    static class Info {
        public int number;
        public int score;

        public Info(int number, int score) {
            this.number = number;
            this.score = score;
        }
    }

    public static void main(String[] args) throws IOException {
        st.nextToken();
        n = (int) st.nval;
        st.nextToken();
        m = (int) st.nval;
        target = (int) (m * 1.5);

        for (int i = 0; i < n; i++) {
            st.nextToken();
            int a = (int) st.nval;
            st.nextToken();
            int b = (int) st.nval;
            if (b >= target) {
                Info info = new Info(a, b);
                list.add(info);
            }
        }
        list.sort(new Com());
        target = list.get(target).score;
        for (int i = 0; i < list.size(); i++) {
            int cur = list.get(i).score;
            if(cur >= target){
                list2.add(list.get(i));
            }
        }


        list2.sort(new Com());
        System.out.println(target + " " + list2.size());
        for (Info info : list2) {
            System.out.println(info.number + " " + info.score);
        }
    }

    static class Com implements Comparator<Info> {

        @Override
        public int compare(Info o1, Info o2) {
            if (o1.score == o2.score) {
                return o1.number - o2.number;
            }
            return o2.score - o1.score;
        }
    }
}
